package com.prs.crm.domain.official;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
import com.prs.crm.domain.sys.FileTypeMaintain;

/**
 * @author Yanghao
 * @version 创建时间：2012-8-28 16:11:52 个人文件柜
 */
@Entity
@Table(name="official_personalfile")
public class PersonalFile extends BaseEntity {
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer id;
	private String name;
    private String keyWords;
    private String remark;
    private Date lastTime;
    private String lastPerson;
    @ManyToOne(cascade=CascadeType.ALL)
	private PersonalFile parent;
    @OneToMany(mappedBy="parent",cascade=CascadeType.ALL)
	private Set<PersonalFile> childs;
	private String type;
	private String control;
	private String controlId;
	private String visit;
	private String visitId;
	private int state;
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach;

	@ManyToOne
	private FileTypeMaintain fileTypeMaintain;
	/**
	 * 1，可以修改 2不能修改
	 */
	private Integer upState;
	/**
	 * 1，为显示   2，不显示
	 */
	private Integer viState;
	private Integer vistates;
	public Integer getVistates() {
		return vistates;
	}
	public void setVistates(Integer vistates) {
		this.vistates = vistates;
	}
	public Integer getUpState() {
		return upState;
	}
	public void setUpState(Integer upState) {
		this.upState = upState;
	}
	public Integer getViState() {
		return viState;
	}
	public void setViState(Integer viState) {
		this.viState = viState;
	}
	public FileTypeMaintain getFileTypeMaintain() {
		return fileTypeMaintain;
	}
	public void setFileTypeMaintain(FileTypeMaintain fileTypeMaintain) {
		this.fileTypeMaintain = fileTypeMaintain;
	}
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Date getLastTime() {
		return lastTime;
	}
	public void setLastTime(Date lastTime) {
		this.lastTime = lastTime;
	}
	public String getLastPerson() {
		return lastPerson;
	}
	public void setLastPerson(String lastPerson) {
		this.lastPerson = lastPerson;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getKeyWords() {
		return keyWords;
	}
	public void setKeyWords(String keyWords) {
		this.keyWords = keyWords;
	}

	public PersonalFile getParent() {
		return parent;
	}
	public void setParent(PersonalFile parent) {
		this.parent = parent;
	}
	public Set<PersonalFile> getChilds() {
		return childs;
	}
	public void setChilds(Set<PersonalFile> childs) {
		this.childs = childs;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getControl() {
		return control;
	}
	public void setControl(String control) {
		this.control = control;
	}
	public String getControlId() {
		return controlId;
	}
	public void setControlId(String controlId) {
		this.controlId = controlId;
	}
	public String getVisit() {
		return visit;
	}
	public void setVisit(String visit) {
		this.visit = visit;
	}
	public String getVisitId() {
		return visitId;
	}
	public void setVisitId(String visitId) {
		this.visitId = visitId;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
}
